<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="../js/jquery-1.8.0.min.js"></script>
<title>Insert title here</title>
<script type="text/javascript">
	$(function(){
		$("#s1").change(function(){
			var v = $("#s1 :selected").val();
			$("#s2 option").remove();
			for(var i=0;i<v;i++){
				var op = $("<option value="+i+">"+i+"</option>");
				$("#s2").append(op);
			}
		});
	});
</script>
</head>
<body>
<select id="s1">
	<option value="1">1</option>	
	<option value="2">2</option>	
	<option value="3">3</option>	
</select>
<select id="s2"></select>
</body>
</html>